class AddQuestionFields < ActiveRecord::Migration
  def self.up
    add_column :questions, :kind, :string, :limit => 40
    add_column :questions, :by_country, :boolean
    add_column :questions, :by_cross_border, :boolean
    
    add_column :answers, :option_id, :integer
    
    create_table :question_options do |t|
      t.references :question
      t.string :text
      t.timestamps
    end
    
  end

  def self.down
    remove_column :questions, :kind
    remove_column :questions, :by_country
    remove_column :questions, :by_cross_border
    
    remove_column :answers, :option_id
    
    drop_table :question_options
  end
end
